﻿using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using Orther.Model.param;
using Orther.Service.Sys;
using Project.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.Core.ManageUser;
using VOL.Entity.DomainModels;

namespace Orther.BLL.Sys
{
    public class OperateLogBLL
    {
        OperateLogService operateLogService = new OperateLogService();
        public TData<List<operatelog>> GetPageList(OperatelogParam param, Pagination pagination)
        {
            TData<List<operatelog>> obj = new TData<List<operatelog>>();
            if (!UserContext.Current.IsSuperAdmin)
            {
                param.deptIds = UserContext.Current.GetAllChildrenDeptIds();
            }
            obj.Data = operateLogService.GetPageList(param, pagination);
            obj.Tag = 1;
            obj.Total = pagination.TotalCount;
            return obj;
        }

        public async Task<TData<List<operatelog>>> GetList(OperatelogParam param, int? topNum)
        {
            TData<List<operatelog>> obj = new TData<List<operatelog>>();
            if (!UserContext.Current.IsSuperAdmin)
            {
                param.deptIds = UserContext.Current.GetAllChildrenDeptIds();
            }
            obj.Data = await operateLogService.GetList(param, topNum);
            obj.Tag = 1;
            return obj;
        }


    }
}
